package com.saas.aop;

import java.lang.reflect.Proxy;

public class ProxyCar {
    public static void main(String[] args) {
        ICar car = new Car();
        CarInvocatioHandler invocatioHandler = new CarInvocatioHandler(car);
        ICar proxy = (ICar) Proxy.newProxyInstance(car.getClass().getClassLoader(), car.getClass().getInterfaces(), invocatioHandler);
        proxy.use();
    }
}
